import request from '@/utils/request'
import qs from "qs";

import {
	toast,
	clearStorageSync,
	setStorageSync,
	getStorageSync,
	useRouter,
	UrlSearchParam
} from '@/utils/utils.js'

// 系统信息
export const loginInfo = data => request({
	method: 'post',
	url: '/loginInfo'
})

//登陆
export const login = data => request({
	method: 'post',
	url: '/doLogin',
	params: data
})

//检测版本升级
export const checkVersion = data => request.post('/api/appSupport/checkVersion', data)

// 获取imtoken
export const getIMToken = data => request.post('/api/IMServerCommon/getIMToken', data)

export const changeIMUserStatus = data => request({
	method: 'post',
	url: '/api/imUserStatus/changeUserStatus',
	params: data
})


export const page = data => request({
	method: 'post',
	url: '/api/appSupport/pageData',
	params: data
})


// 验证当前账号是否能上线
export const checkLawyerPlan = data => request({
	method: 'post',
	url: '/api/lawyerPlanMgr/checkLawyerPlan',
	params: data
})

// 修改律师状态
export const changeLawyerStatus = data => request({
	method: 'post',
	url: '/api/lawyerPlanMgr/changeLawyerStatus',
	params: data
})

//退出
export const logout = data => request.post('/api/userManager/logout', data)

// 获取用户信息
export const userInfo = data => request.post('/api/appSupport/userInfo', data)

// 获取账号权限列表
export const getSystemRoles = data => request.post('/api/acommon/getSystemRole', data)
// 咨询类型
export const getICTypes = data => request.post('/api/acommon/getICTypes', data)
// 咨询标签
export const getTagOptions = data => request.post('/api/IMServerCommon/getTagOptions', data)
// 提交标签
export const submitTag = data => request.post('/api/IMServerCommon/submitTag', data)

// 快捷回复
export const quickReplies = data => request.post('/api/IMServerCommon/quickReplies', data)
//发送消息
export const sendMessage = data => request.post('/api/IMServerCommon/sendMessage', data)

// 结束服务
export const finishService = data => request({
	method: 'post',
	url: '/api/IMServerCommon/finishService',
	params: data
})

//spdata  
export const spFullTree = data => request.post('/api/dictionaryManager/dicSpecialty/getFullTree', data)

// 修改咨询件业务类型
export const modifyDicSpecialty = data => request.post('/api/IMServerCommon/modifyDicSpecialty', data)

// 数据字典
export const getDics = data => request({
	method: 'post',
	url: '/api/dictionaryManager/labelvalue/getDicByCategory',
	params: data
})



// 首页今日数据
export const todayData = data => request.post('/api/appSupport/todayData', data)

// 获取即时咨询待抢单数据
export const getWaitingList = data => request.post('/api/appSupport/getWaitingList', data)

// 抢单操作
export const grabbingConsultation = data => request({
	method: 'post',
	url: '/api/grabbingHall/grabbingConsultation',
	params: data
})

// 获取律师所有班次类型的上下线状态
export const getLawyerAllStatus = data => request.post('/api/lawyerPlanMgr/getLawyerAllStatus', data)

// 获取当前发布中的班次信息
export const getCalendarPlans = data => request.post('/api/schedulingPlanCalendar/getPlans', data)

//咨询列表
export const consultationList = data => request.post('/api/appSupport/consultationList', data)

// 获取当前可抢单的律师列表
export const getAssignLawyers = data => request({
	method: 'post',
	url: '/api/grabbingHall/getAssignLawyers',
	params: data
})

// 介入咨询
export const interposeConsultant = data => request.post('/api/consultantApi/interposeConsultant', data)


//回复咨询
export const reply = data => request.post('/api/icmc/consultationReply/reply', data)
// 审核
export const audit = data => request.post('/api/icmc/consultationAudit/audit', data)

// 获取配置规则
export const getAllConfigCacheByType = data => request({
	method: 'post',
	url: '/api/schedulingRuleMgr/getAllConfigCacheByType',
	params: data
})

// 即时咨询历史
export const getIMHistory = data => request({
	method: 'post',
	url: '/api/IMServerCommon/getIMHistory',
	params: data
})

// 历史记录
export const findConsultantHisChart = data => request.post('/api/appSupport/findConsultantHisChart', data)

// 咨询件信息
export const getChartInfo = data => request({
	method: 'post',
	url: '/api/IMServerCommon/getChartInfo',
	params: data
})


// 满意度选项
export const satisfactionResultOptions = data => request.post('/api/satisfactionCommon/satisfactionResultOptions')

// 满意度子项
export const evaluationDimensionOptions = data => request.post('/api/satisfactionCommon/evaluationDimensionOptions')

// 咨询满意度结果
export const satisfactionLog = data => request({
	method: 'post',
	url: '/api/satisfactionCommon/satisfactionLog',
	params: data
})

// 项目列表
export const getProjects = data => request({
	method: 'post',
	url: '/api/projectManagement/getProjects',
	params: data
})

// 班次列表
export const planList = data => request.post('/api/appSupport/planList', data)

// 修改抢班人数
export const modifyGrabbingNum = data => request({
	method: 'post',
	url: '/api/schedulingPlanMgr/changeGrabbingNum',
	params: data
})
// 关闭班次
export const canceledPlan = data => request({
	method: 'post',
	url: '/api/schedulingPlanMgr/canceledPlan',
	params: data
})
//发布班次
export const publishPlan = data => request.post('/api/schedulingPlanMgr/publishPlanByData', data)

// 律师抢单
export const grabbingPlan = data => request({
	method: 'post',
	url: '/api/schedulingPlanMgr/grabbingPlan',
	params: data
})

// 取消预约
export const cancelReservationPlan = data => request.post('/api/schedulingPlanMgr/cancelReservationPlan', data)


// 班次详情
export const planFullDetail = data => request({
	method: 'post',
	url: '/api/schedulingPlanMgr/planFullDetail',
	params: data
})

// 删除指定班次的律师
export const delLawyerMapping = data => request({
	method: 'post',
	url: '/api/schedulingPlanMgr/delLawyerMapping',
	params: data
})

// 班次可选择律师列表
export const planLawyerList = data => request.post('/api/appSupport/planLawyerList', data)

// 添加班次律师
export const savePlanLawyers = data => request.post('/api/appSupport/savePlanLawyers', data)

// 获取聊天关键词
export const getKeyWords = data => request({
	method: 'post',
	url: '/api/IMServerCommon/getKeyWords',
	params: data
})

export const getKnowledgeDetail = data => request({
	method: 'post',
	url: '/api/knowledge/getDetail',
	params: data
})

export const esSearchKnowledge = data => request.post('/api/es/search', data)